<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>js的while语句</title>
		<script>
			
			//1-100求和
			var sum = 0;
			var num = 1;
			while(num <= 100){
				sum+=num;
				num++;
			}
			alert(sum);
		</script>
	</head>
	<body>
	</body>
</html>
